import request from '@/utils/request'

export function init(currentPage) {
  return request({
    url: '/bs/init',
    method: 'get',
    params: {
      currentPage
    }
  })
}

export function update(form) {
  return request({
    url: '/bs/update',
    method: 'post',
    data: {
      form
    }
  })
}

export function getDetail(id) {
  return request({
    url: '/bs/getDetail',
    method: 'get',
    params: {
      id
    }
  })
}

export function search(pageNo, word) {
  return request({
    url: '/bs/search',
    method: 'get',
    params: {
      pageNo,
      word
    }
  })
}

export function removePhoto(id) {
  return request({
    url: '/bs/deletePhoto',
    method: 'post',
    data: {
      id: id
    }
  })
}

export function sortPhoto(id, direction) {
  return request({
    url: '/bs/sortPhoto',
    method: 'post',
    data: {
      id: id,
      direction: direction
    }
  })
}

